package com.surfacing.rcp.model.entity;

import com.surfacing.rcp.model.common.AbstractMessage;

public class StatEinsatzart extends AbstractMessage {
	// unique identification string
	public final static String ID = "StatEinsatzart";

	private String name;
	private String anzahl;

	/**
	 * Class constructor for a staff member
	 */
	public StatEinsatzart() {
		super(ID);
		// set default values
		name = "";
		anzahl = "";
	}

	/**
	 * Class constructor for a complete staff member
	 * 
	 * @param firstName
	 *            the first name
	 * @param lastName
	 *            the last name
	 * @param userName
	 *            the username of this member
	 */
	public StatEinsatzart(String name, String anzahl) {
		this();
		setName(name);
		setAnzahl(anzahl);
	}

	/**
	 * Returns a string based description of the object
	 * 
	 * @return the description of the object
	 */
	@Override
	public String toString() {
		return name + " " + anzahl;
	}

	/*
	 * Returns the calculated hash code based on the staff member id.<br> Two
	 * staff members have the same hash code if the id is the same.
	 * 
	 * @return the calculated hash code
	 */
	@Override
	public int hashCode() {
		return 31 + name.length();
	}

	/**
	 * Returns whether the objects are equal or not.<br>
	 * Two staff members are equal if, and only if, the id is the same.
	 * 
	 * @return true if the id is the same otherwise false.
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final StatEinsatzart other = (StatEinsatzart) obj;
		if (!name.equals(other.name))
			return false;
		return true;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAnzahl() {
		return anzahl;
	}

	public void setAnzahl(String anzahl) {
		this.anzahl = anzahl;
	}

}
